<%@ page contentType="text/html;charset=UTF-8" language="java" %>  
<%@include file="/common/jsp/common_header.jsp"%>
<html>
	<script>
        var body_width=150;
        var body_height=150;
    </script>
	<link href="<%=request.getContextPath()%>/ui/skin/donave/css/global.css"
			rel="stylesheet" type="text/css">
	<link href="<%=request.getContextPath()%>/ui/skin/donave/css/popdiv.css"
		rel="stylesheet" type="text/css">
	<link href="<%=request.getContextPath()%>/ui/skin/donave/jscalendar/calendar-win2k-cold-1.css"
		rel="stylesheet" type="text/css" media="all">
	<script type="text/javascript"> 
	var validater;
	$().ready(function() {
			validater=$("#updateFolder").validate({
				rules: {
					"columns.name": "required",
					"columns.sortCode": {
						number: true
					}
				}
			});
			
		});
    function doSave() {
    if(!validater.form()){
    	return;
    }
           $("#updateFolder").attr("action",ctx+"/cms/cmsfold!updateFolder.action?refreshTree=true");
           $("#updateFolder").submit();
    }
 
    function createFolder() {
    	var parentId = $("#columnsId").val();
       var url = ctx+"/cms/cmsfold!goAddFolder.action?columns.parentId="+parentId+"&needAjax=true";
        x_open('新建子栏目', url, document.body.offsetWidth - body_width, document.body.offsetHeight - body_height);
    }
</script>
<body>
<s:form cssStyle="margin:0" name="updateFolderForm" 
	 method="post" id="updateFolder" theme="simple">
	<s:hidden name="columns.id" id="columnsId"/>
	<s:hidden name="columns.parentId" />
	<s:hidden name="refreshTree"  id="refreshTree"/>
	<table width="100%" class="common_input_table">
		<tr>
			<td colspan="2" class="listtitle">
				<b>  <s:property value="columns.name"/></b>
			</td>
		</tr>
		<tr>
			<td class="common_td_lable" height="30" width="20%">
				名称
			</td>
			<td class="common_td_text_left">
				<s:textfield name="columns.name" id="columnsName" cssClass='borderInput'
					theme="simple" maxlength="50" size="80%" />
				<span class="interim">&nbsp;<font color="red">*</font> </span>
			</td>
		</tr>
		<script type="text/javascript">
        var refreshTree =$("#refreshTree").val();
        if (refreshTree == "true") {
           var name = $("#columnsName").val();
           parent.parent.frames[0].tree.refreshName(name);
        }
    </script>
		<tr>
			<td class="common_td_lable" height="30">
				创建者
			</td>
			<td class="common_td_text_left">
				<s:property value="columns.creator" />
			</td>
		</tr>
		<tr>
			<td class="common_td_lable" height="30">
				创建时间
			</td>
			<td class="common_td_text_left">
				<s:property value="columns.createTime" />
			</td>
		</tr>
		<tr>
			<td class="common_td_lable" height="30">
				排序号
			</td>
			<td class="common_td_text_left">
				<s:textfield name="columns.sortCode" cssClass='borderInput'
					theme="simple" maxlength="5" size="10%" />
			</td>
		</tr>
		<tr>
			<td class="common_td_lable" height="30">
				信息发布方式
			</td>
			<td class="common_td_text_left">
				<s:select name="columns.releaseMode" id="selPublicMode" list="#{0:'直接发布'}"></s:select>
				<script language="javascript">
                $("#selPublicMode").value = "<s:property value="columns.releaseMode"/>";
            </script>
			</td>
		</tr>
	</table>
	</td>
	</tr>
	</table>
	</div>
	</td>
	</tr>
	<tr>
		<td height='24' valign='bottom'>
			<table width='100%'>
				<tr>
					<td class='footerTd'>
						&nbsp; &nbsp;
                        <input type="button" class="button2" value="保存"
                           onclick="doSave();">
						&nbsp; &nbsp;
						<input type="button" class="button2" value="新建"
                           onclick="createFolder();">
						&nbsp; &nbsp;
					</td>
				</tr>
			</table>
		</td>
	</tr>
	</table>
</s:form>
	</body>
</html>

